<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .div1{
            padding: 10px;
            border: 3px solid black;
        }
        .div2{
            border: 3px solid red;
        }
        .div2 img{
            /* position: absolute; */
            float: left;
            padding: 10px;
        }
        .div2::after{
            content: '';
            display: block;
            clear: left;
        }
    </style>
</head>
<body>
    <div class="div1">
        <img src="https://img.36krcdn.com/20220426/v2_5814a8cee8d049f18c53abadea45dbf9_img_png" alt="">
    </div>
    <div class="div2">
        <img src="https://img.36krcdn.com/20220426/v2_a3197c53e05947b49abd21cce9d0716e_img_png" alt="">
    </div>
</body>
</html>